// 适配器。将已有方法二次封装，使其符合目标的调用习惯
class Plug {
    getName() {
        console.log("this is Plug");
    }
}

class Wrap {
    constructor(plug) {
        this.plug = new Plug();
    }
    sayName() {
        this.plug.getName();
    }
}

function main() {
    let w = new Wrap();
    w.sayName();
}

main();
